<?php

namespace app\admin\model;

use think\Model;
use traits\model\SoftDelete;
class Trackdetail extends Model
{
    use SoftDelete;
    // 表名
    protected $name = 'track_detail';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'integer';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';
    protected $deleteTime = 'deletetime';

    // 追加属性
    protected $append = [

    ];

    public function track()
    {
        return $this->belongsTo('Track', 'track_id', 'id', [], 'LEFT')->setEagerlyType(0);
    }


    public function department()
    {
        return $this->belongsTo('Department', 'department_id', 'id', [], 'LEFT')->setEagerlyType(0);
    }


    public function group()
    {
        return $this->belongsTo('app\admin\model\auth\Group', 'group_id', 'id', [], 'LEFT')->setEagerlyType(0);
    }
}
